package com.neusoft.elmboot.mapper;

import com.neusoft.elmboot.po.Comment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CommentMapper {

    @Insert("insert into elm.comment (userId, businessId, remark) VALUES (#{userId}, #{businessId}, #{remark})")
    void createComment(Comment comment);

    @Select("select id from elm.comment where userId = #{userId}")
    List<Integer> getCommentIdByUserId(String userId);

    void delCommentUser(List<Integer> commentIdList);

    @Select("select * from elm.comment where businessId = #{businessId}")
    List<Comment> getCommetByBusinessId(String businessId);
}
